//
//  XMPPManager.h
//  MyChatDemo
//
//  Created by DragonYao on 2017/9/12.
//  Copyright © 2017年 DragonYao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "XMPP.h"

typedef NS_ENUM(NSUInteger, XMPPResultType) {
    XMPPResultTypeLoginConnecting,//正在连接服务器
    XMPPResultTypeLoginSuccess,//登录成功
    XMPPResultTypeLoginFailure,//登录失败
    XMPPResultTypeRegisterSuccess,//注册成功
    XMPPResultTypeRegisterFailure,//注册失败
    XMPPResultTypeNetError  //网络连接超时，或者失败
};

typedef void(^XMPPResultBlock)(XMPPResultType type);

@interface XMPPManager : NSObject

+ (XMPPManager *)sharedManager;

@property (nonatomic, strong) XMPPStream *xmppStream;
@property (nonatomic, strong) XMPPvCardTempModule *vCartModule;//电子名片模块
@property (nonatomic, strong) XMPPRosterCoreDataStorage *rosterStorage;//花名册存储
@property (nonatomic, strong) XMPPRoster *roster;//花名册模块【好友列表】
@property (nonatomic, strong) XMPPMessageArchiving *msgArvhiving;//消息归档
@property (nonatomic, strong) XMPPMessageArchivingCoreDataStorage *msgStorage;//消息存储数据库
////接入流管理模块，用于流恢复跟消息确认，在移动端很重要
//XMPPStreamManagementMemoryStorage XMPPStreamManagement
@property (nonatomic, strong) XMPPStreamManagement *xmppManagement;
@property (nonatomic, strong) XMPPStreamManagementMemoryStorage *managementMemoryStorage;
//文件传输
@property (nonatomic, strong) XMPPIncomingFileTransfer *fileTransfer;

/**
 *  区分登录（NO） 还是 注册（YES）
 */
@property (nonatomic, assign, getter=isRegisterOption) BOOL registerOption;

/**
 *  用户退出
 */
- (void)userLogout;

/**
 *  用户登录
 */
- (void)userLogin:(XMPPResultBlock)resultBlock;

/**
 *  用户注册
 */
- (void)userRegitser:(XMPPResultBlock)resultBlock;

@end
